package documentooborot.DAO.entities;

import java.util.Date;

import javax.persistence.Id;

import com.googlecode.objectify.annotation.Serialized;

import documentooborot.domain.User;

public class Event {
	private String aggregateClass;
	private String aggregateId;
	private String method;
	@Id private String fullname;
	private long version;
	@Serialized
	private Object data;
	private Date timestamp;
	private User source;
	private Event() {}
	public Event(String aggregateClass, String aggregateId, String method, User user) {
		timestamp=new Date();
		fullname = (aggregateClass!=null?aggregateClass:"")
					+(aggregateId!=null?aggregateId:"")
					+(method!=null?method:"")
					+(user.getName());
	}
}
